/*
* @Date: 2017-12-15
* @by:   chenxiaomian
*/
$(function(){
    if($(".spc-item").length>0){
        var iWidth = 0,
            iMargin = 0;
        $(".spc-item").each(function(){
            iWidth += $(this).width();
        });
        iMargin = $(".spc-item").length * 10;
        $(".spc-box-wrap").width(iWidth+iMargin+15);
        var mySwiper = new Swiper('.spc-box', {
            direction: 'horizontal',
            slidesPerView : 'auto',
            slidesPerGroup : 1,
            wrapperClass : 'spc-box-wrap',
            slideClass: 'spc-item',
            nextButton: '.spc-next',
            prevButton: '.spc-prev',
        });
    }
});